//
//  CashCell.m
//  QoilPublic
//
//  Created by SunChao on 17/9/7.
//  Copyright © 2017年 杨凯. All rights reserved.
//

#import "CashCell.h"
#import "BingdingVC.h"
@implementation CashCell


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    _moneyText.placeholder = @"请输入";
    UILabel *label1=[[UILabel alloc]initWithFrame:CGRectMake(-20, 20, 80, 30)];
    label1.text = @"提现金额";
    label1.font = [UIFont systemFontOfSize:15];
    label1.textAlignment = NSTextAlignmentCenter;
    _moneyText.leftView=label1;
    [_moneyText addTarget:self action:@selector(textAction:) forControlEvents:UIControlEventEditingChanged];
    _moneyText.leftViewMode=UITextFieldViewModeAlways; //此处用来设置leftview现实时机
    _moneyText.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
    _moneyText.keyboardType = UIKeyboardTypeDecimalPad;
    [_moneyText.layer setBorderWidth:0.5f];
    [_moneyText.layer setBorderColor:[UIColor groupTableViewBackgroundColor].CGColor];
    _moneyText.layer.cornerRadius = 5;
    _moneyText.layer.masksToBounds = YES;
     [_moneyText.layer setBorderColor:[UIColor colorWithRed:210/255 green:210/255 blue:210/255 alpha:0.5f].CGColor];
    [_tiXianView.layer setBorderWidth:0.5f];
    [_tiXianView.layer setBorderColor:[UIColor colorWithRed:210/255 green:210/255 blue:210/255 alpha:0.5f].CGColor];
    _tiXianView.layer.cornerRadius = 5;
    _tiXianView.layer.masksToBounds = YES;
    
    UILabel *rightView = [[UILabel alloc] init];
    rightView.frame = CGRectMake(0, 0, 30, 30);
    rightView.text = @"元";
    rightView.textAlignment = NSTextAlignmentCenter;
    rightView.textColor = [UIColor colorWithRed:210/255 green:210/255 blue:210/255 alpha:1.0f];
    _moneyText.rightView =rightView;
    _moneyText.rightViewMode = UITextFieldViewModeAlways;
    
}

//点击修改提现账户
- (IBAction)editCardAction:(id)sender {
    
    [QViewUtility showAlertChooseViewWithImage:[UIImage imageNamed:@"smile_image"] content:@"之前绑定账户将不能使用" leftTitle:@"取消" rightTitle:@"确定" type:1 myBlock:^(NSInteger tag) {
        if(tag == 1){
            UIViewController *vc = [QViewUtility getCurrentVC];
            BingdingVC *bing = [[BingdingVC alloc]init];
            [vc.navigationController pushViewController:bing animated:YES];
            
        }
        
    }];
}

- (void)textAction:(UITextField *)textField{
    if(self.block){
        self.block(textField);
    }
}

@end
